package homeWork.five.demo4;
import java.util.Scanner;
class Ball {
    private int r;//半径

    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }
}
class Billiards extends Ball {
    private String color;//颜色

    @Override
    public int getR() {
        return super.getR();
    }

    @Override
    public void setR(int r) {
        super.setR(r);
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
public class TestDemo {
    public static void main(String[] args) {
        Billiards billiards = new Billiards();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入台球的颜色");
        String color = scanner.next();
        System.out.println("请输入台球的半径");
        int r = scanner.nextInt();
        billiards.setR(r);
        billiards.setColor(color);
        System.out.println("台球半径 : " + billiards.getR());
        System.out.println("台球颜色 : " + billiards.getColor());
    }
}
